#ifndef YUV_IO_CTL_H
#define YUV_IO_CTL_H
#include <stdint.h>

enum YuvPlanarE
{
    YUV_PLANAR_NV21,
    YUV_PLANAR_NV12,
    YUV_PLANAR_YV12,
    YUV_PLANAR_YU12,
    
};

enum YuvTypeE
{
    YUV_420,
    YUV_422,
};

typedef struct YuvIoS YuvIoT;

struct YuvIoOpsS
{
    uint8_t (*readY)(YuvIoT *, int /* x */, int /* y */); /* x/y : 0,1,2,...*/
    uint8_t (*readU)(YuvIoT *, int , int );
    uint8_t (*readV)(YuvIoT *, int , int );
    void (*dtor)(YuvIoT *);
};

struct YuvIoS
{
    struct YuvIoOpsS *ops;
};

YuvIoT *YuvIoInstance(char *file, int picW, int picH, int datW, int datH, 
                    enum YuvPlanarE planar);

#endif
